package list.functions.applier;

/**
 *
 * Fully Tested: No
 * Fully Documented: No
 * Created: 11-Apr-2012
 * Last Updated: 11-Apr-2012
 *
 * @author Shimu Wu
 */
public class ApplierGenerator {

    private ApplierGenerator() {
    }
    
    /**
     * An applier that adds all the given integer together. Returns 0
     * if no arguments are given.
     */
    public static final Applier<Integer, Integer> ADD =
            new Applier<Integer, Integer>() {

                public Integer apply(Object... args) {
                    int sum = 0;
                    for (Object e : args) {
                        sum += (Integer) e;
                    }
                    return sum;
                }
            };

}
